1. Field of the Invention
The present invention relates to an image reading apparatus and image reading method for reading a document image.
2. Description of the Related Art
A general image reading apparatus reads an image by controlling the light source formed from an LED or the like to irradiate a document to be read with light, photoelectrically converting reflected light from the document by a line image sensor made up of a plurality of elements, and storing charges. While scanning a document, the line image sensor having a length corresponding to the document width reads an image line by line. Image data of one line obtained by reading an image of one line are processed for each pixel from image data of a pixel read by an element of the sensor at one end.
FIG. 6 is a block diagram for explaining the sequence of processes executed for image data of one pixel. Image data of a 1-line image read by an image sensor 116 are serially transferred for each pixel to an A/D convert portion 112. The A/D convert portion 112 converts the image data into digital data, and outputs the digital data to a reading control portion 107. In the reading control portion 107, an image data packing portion 201 packs image data input from the A/D convert portion 112 into 16 bits per image data of one pixel. Then, a shading correction portion 202 and γ correction portion 203 perform shading correction and γ correction, respectively. The γ correction corrects the level of an input image signal and outputs the corrected image signal so as to print the image at a proper density. An image extraction portion 204 extracts only image data of a specific range, and an image data compression portion 205 compresses the extracted image data. The compressed image data are sequentially stored via a DMA controller 117 in a RAM incorporated in the image reading apparatus.
Recently, it is demanded to read an image at high speed. This requires an image sensor capable of reading at high speed. Such an image sensor is a line image sensor which has a length corresponding to the document width and includes a plurality of chips. This sensor is different from the above-mentioned “single output type” image sensor which serially outputs image data of pixels from one read by an element at an end. A sensor of this type is called a “multi-output type” image sensor. The “multi-output type” image sensor is configured by connecting a plurality of sensor chips into a line. The sensor chips parallel-output image data to read the image at high speed. For example, three sensor chips are arranged to parallel-output three 1-line image data. This “multi-output type” image sensor can achieve a reading speed triple that of the “single output type” image sensor.
Japanese Patent Laid-Open No. 7-298266 discloses a decoding apparatus which selects and outputs desired image data. The decoding apparatus comprises a means for determining image data when sequentially receiving coded image data having undergone two different types of processes. Since the type of image data is determined to change a subsequent process, the determination circuit is complicated.
The image data compression portion (encoding portion) 205 in FIG. 6 compresses image data in order to, for example, reduce the capacity of the RAM for temporarily storing image data. As this method, the image data compression portion 205 adopts a DPCM encoding method to compress image data of a target pixel from 16 bits into 8 bits based on a preceding pixel. Image data compression techniques include a modeling technique of modeling an image signal, and a coding technique of actually assigning a code to a signal sequence converted by the modeling technique. Examples of the modeling technique are run-length modeling, Markov modeling, and DPCM (Differential Pulse Code Modulation). As the coding technique, Huffman coding and arithmetic coding are known. Of these techniques, DPCM uses an image data feature that a given pixel value is highly likely to take a value close to an immediately preceding pixel value. DPCM is becoming popular as an image data compression technique. However, according to this compression method, image data of a preceding pixel does not exist for image data of a pixel output first from the image sensor for each line of a read image. For this reason, image data of a pixel output first from the image sensor is not compressed by the DPCM encoding method based on a preceding pixel, but is compressed from 16-bit data into 8-bit data by using upper 8-bit data out of 16-bit data of one pixel. That is, image data is compressed into compressed data [7:0]=data [15:8] before compression. Image data of succeeding pixels are sequentially compressed by the DPCM encoding method, and sequentially stored in the RAM.
The compressed image data are sequentially read out from the RAM via the DMA controller, and sequentially decompressed from 8 bits into 16 bits by an image data decompression portion in the image reading apparatus. As described above, image data of a pixel output first from the image sensor has been compressed using upper 8 bits out of image data before compression. In decompression, therefore, image data is decompressed using 8-bit data before decompression input to the decompression portion as lower 8-bit data of a 16-bit decompressed output. Image data of pixels subsequently input to the decompression portion have been compressed based on preceding pixels by the DPCM encoding method. Similarly in decompression, the data is decompressed into 16 bits based on the DPCM decoding method, that is, a preceding pixel. That is, decompression is done by changing the decompression method in decompression depending on the pixel of image data.
In a “multi-output type” image sensor, one line includes a plurality of sensor chips. To compress and decompress image data of one line, the sensor having this arrangement must hold a line memory for one line. When reading an image, image data are parallel-output from sensor chips of one line in order to increase the reading speed. As for a pixel at the boundary between sensor chips, image data of a preceding pixel has already been output from the sensor in compression, and does not exist. This is because differential coding requires a line memory for holding image data of one line.
Japanese Patent Laid-Open No. 7-298266 discloses a technique of adopting a circuit for determining the compression method of compressed image data, and executing different processes in accordance with the determination result. This technique employs a circuit which discriminates interframe image data from intraframe image data when interframe image data and intraframe image data having undergone different compression processes are sequentially input. Japanese Patent Laid-Open No. 7-298266 discloses a method of changing a processing method output at the timing when input image data is determined as intraframe image data. Note that interframe image data is image data compressed by calculating the difference between a preceding frame and the current frame. Intraframe image data is image data compressed within the current frame without calculating the difference between a preceding frame and the current frame. However, the means for determining whether input image data is interframe image data or intraframe image data undesirably complicates the circuit and raises the cost.
In an image reading apparatus using a multi-output type image sensor, it is difficult to process 1-line image data at high speed by a relatively simple circuit arrangement without newly holding a line memory in compression. In addition, no reference concretely discloses the arrangement.